<?php $this->load->view('admin/public/head.html', array('css' => array(
'/assets/admin/css/admin/common.css'
))); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper userAdmin" ng-controller="admin-user-detail-controller">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            用户详情
            <small>用户个人信息</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="/home"><i class="fa fa-dashboard"></i> 后台首页</a></li>
            <li><a href="/user/lists/index">会员列表</a></li>
            <li class="active">个人详情</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <!-- Your Page Content Here -->
        <!-- row -->
        <div class="row">
            <!-- 用户资料 -->
            <div class="col-md-4">
                <div class="box box-widget widget-user">
                    <!-- Add the bg color to the header using any of the bg-* classes -->
                    <div class="widget-user-header bg-aqua-active">
                        <h3 class="widget-user-username" ng-bind="detail.nickName"></h3>
                        <h5 class="widget-user-desc">
                            <span class="label" ng-bind="'苹果客户端'" ng-if="detail.source == 'ios'"></span>
                            <span class="label" ng-bind="'安卓客户端'" ng-if="detail.source == 'android'"></span>
                            <span class="label" ng-bind="'微信'" ng-if="detail.source == 'wx'"></span>
                        </h5>
                    </div>
                    <div class="widget-user-image">
                        <img class="profile-user-img img-responsive img-circle"
                             src="<?=value($user, 'avatar')?>"
                             onerror="this.src='/assets/admin/img/head.png'"
                             alt="<?=value($user, 'nickName')?>">
                    </div>
                    <div class="box-footer">
                        <div class="row">
                            <div class="col-sm-4 border-right">
                                <div class="description-block">
                                    <h5 class="description-header" ng-bind="'￥' + detail.amount_cny"></h5>
                                    <span class="description-text">钱包</span>
                                </div>
                                <!-- /.description-block -->
                            </div>
                            <!-- /.col -->
                            <div class="col-sm-4 border-right">
                                <div class="description-block">
                                    <h5 class="description-header" ng-bind="detail.score"></h5>
                                    <span class="description-text">积分</span>
                                </div>
                                <!-- /.description-block -->
                            </div>
                            <!-- /.col -->
                            <div class="col-sm-4">
                                <div class="description-block">
                                    <h5 class="description-header" ng-bind="detail.underline"></h5>
                                    <span class="description-text">下线</span>
                                </div>
                                <!-- /.description-block -->
                            </div>
                            <!-- /.col -->
                        </div>
                        <!-- /.row -->
                    </div>
                </div>
                <!-- Profile Image -->
                <div class="box box-primary">
                    <div class="box-body box-profile">
                        <ul class="list-group list-group-unbordered">
                            <li class="list-group-item" style="border-top: none;">
                                <b>联系方式</b> <a class="pull-right"><?=value($user, 'phone', '-')?></a>
                            </li>
                            <li class="list-group-item">
                                <b>积分</b> <a class="pull-right"><?=value($user, 'score')?></a>
                            </li>
                            <li class="list-group-item">
                                <b>最后登录IP</b> <a class="pull-right"><?=value($user, 'lastIp')?> - 上海</a>
                            </li>
                            <li class="list-group-item">
                                <b>最后登录时间</b> <a class="pull-right"><?=value($user, 'lastTime')?></a>
                            </li>
                            <li class="list-group-item">
                                <b>加入时间</b> <a class="pull-right"><?=value($user, 'created')?></a>
                            </li>
                        </ul>
                        <!--
                        <a href="javascript:;" ng-click="chgUserState()" class="btn btn-danger btn-block"><b>禁止使用</b></a>
                        -->
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->

                <!-- About Me Box -->
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">地址管理</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body">
                        <?php if (!empty($address) && is_array($address)) foreach($address as $addr):?>
                        <strong>
                            <i class="fa fa-map-marker margin-r-5"></i> <?=$addr['name']?>
                            <?php if (!empty($addr['default'])): ?>
                            <span class="badge bg-green">默认</span>
                            <?php endif; ?>
                        </strong>

                        <p class="text-muted">联系方式: <?=$addr['phone']?></p>

                        <p class="text-muted">
                            <?=$addr['province']?>
                            <?=$addr['city']?>
                            <?=$addr['area']?>
                            <br>
                            <?=$addr['address']?>
                        </p>

                        <hr>
                        <?php endforeach;?>

                        <strong><i class="fa fa-file-text-o margin-r-5"></i> 说明:</strong>

                        <p>以上地址为用户设置的收货地址,用户数据,管理员禁止更改.</p>
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->
            </div>
            <div class="col-md-8">

                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_1" data-toggle="tab">所有订单</a></li>
                        <li><a href="#tab_2" ng-click="select('bbs')" data-toggle="tab">发帖历史</a></li>
                        <li><a href="#tab_3" ng-click="select('wx_1')" data-toggle="tab">一级分销</a></li>
                        <li><a href="#tab_4" ng-click="select('wx_2')" data-toggle="tab">二级分销</a></li>
                    </ul>
                    <div class="tab-content">
                        <!--订单-->
                        <div class="tab-pane active" style="margin-bottom: 20px;" id="tab_1">
                            <div class="text-center" style="padding: 10px;" ng-if="!order || order.length == 0">
                                暂无订单
                            </div>
                            <div class="box" ng-show="order.length > 0" ng-repeat="o in order">
                                <div class="box-header">
                                    <h5 class="box-title" style="font-size: 14px;" ng-bind="'订单编号: ' + o.sn"></h5>
                                    <span class="pull-right" style="font-size: 12px;" ng-bind="'下单时间: ' + o.created"></span>
                                </div>
                                <!-- /.box-header -->
                                <div class="box-body no-padding">
                                    <table class="table table-condensed">
                                        <tr ng-repeat="g in o.goods" class="order-goods-item">
                                            <td style="width: 60px;">
                                                <img ng-src="{{ g.thumb }}" alt="">
                                            </td>
                                            <td ng-bind="g.goodsName"></td>
                                            <td style="width: 60px;" ng-bind="'x ' + g.num"></td>
                                            <td style="width: 80px;" class="text-danger" ng-bind="'￥' + g.price"></td>
                                        </tr>
                                    </table>
                                </div>
                                <!-- /.box-body -->
                                <div class="box-footer">
                                    <div class="pull-left" ng-bind="'订单状态: ' + o.formatStatus"></div>
                                    <strong style="color: red;" class="pull-right" ng-bind="'总计: ￥' + o.totalPrice"></strong>
                                </div>
                            </div>
                        </div>

                        <!-- /.tab-pane -->
                        <div class="tab-pane" id="tab_2">
                            <div class="text-center" style="padding: 10px;" ng-if="!bbsLists || bbsLists.length == 0">
                                暂无发帖
                            </div>
                            <div class="box" ng-show="bbsLists.length > 0">
                                <!-- /.box-header -->
                                <div class="box-body no-padding">
                                    <table class="table table-condensed">
                                        <tr>
                                            <th class="text-center" style="width: 30px">#</th>
                                            <th class="text-center">内容</th>
                                            <th class="text-center" style="width: 80px;">发布时间</th>
                                            <th class="text-center" style="width: 50px;">喜欢</th>
                                            <th class="text-center" style="width: 50px;">评论</th>
                                            <th class="text-center" style="width: 50px;">附件</th>
                                            <!--
                                            <th class="text-center" style="width: 40px">操作</th>
                                            -->
                                        </tr>
                                        <tr class="v-middle" ng-repeat="b in bbsLists">
                                            <td class="text-center" ng-bind="b.bbsId"></td>
                                            <td>
                                                <a href="/bbs/detail/index?bbsId={{ b.bbsId }}" ng-bind="(b.content | limitTo: 20) + '...'"></a>
                                            </td>
                                            <td class="text-center" ng-bind="b.created"></td>
                                            <td class="text-center" ng-bind="b.likes"></td>
                                            <td class="text-center" ng-bind="b.comments"></td>
                                            <td class="text-center">
                                                <span ng-show="b.attachment.thumb.length > 0" class="fa fa-picture-o text-success"></span>
                                            </td>
                                            <!--
                                            <td class="text-center">
                                                <a href="javascript:void(0);" class="btn btn-xs btn-link">屏蔽</a>
                                            </td>
                                            -->
                                        </tr>
                                    </table>
                                </div>
                                <!-- /.box-body -->
                                <div class="box-footer text-center" ng-show="bbsLoadMore">
                                    <a href="javascript:void(0);" ng-click="loadMoreBbs()" class="uppercase">查看更多</a>
                                </div>
                            </div>
                            <!-- /.box -->
                        </div>
                        <!-- /.tab-pane -->
                        <div class="tab-pane" id="tab_3">
                            <div class="text-center" style="padding: 10px;" ng-if="!wxLevel1 || wxLevel1.length == 0">
                                暂无下线
                            </div>
                            <div class="box" ng-show="wxLevel1.length>0">
                                <div class="box-body no-padding">
                                    <table class="table table-condensed">
                                        <tr>
                                            <th class="text-center" style="width: 90px">用户ID</th>
                                            <th class="text-center" style="width: 80px;">头像</th>
                                            <th class="text-center" style="width: 150px;">昵称</th>
                                            <th class="text-center" style="width: 80px;">创建时间</th>
                                            <th class="text-center" style="width: 80px;">钱包</th>
                                            <th class="text-center" style="width: 80px;">积分</th>
                                            <th class="text-center" style="width: 80px">操作</th>
                                        </tr>
                                        <tr class="v-middle" ng-repeat="w1 in wxLevel1">
                                            <td class="text-center" ng-bind="w1.userId"></td>
                                            <td class="text-center">
                                                <img class="underline-headimg" ng-src="{{ w1.headimgurl ? w1.headimgurl : '/assets/admin/img/head.png' }}" onerror="this.src='/assets/admin/img/head.png'" alt="">
                                            </td>
                                            <td class="text-center">
                                                <a href="/user/detail/index?id={{ w1.userId }}" ng-bind="w1.nickname"></a>
                                            </td>
                                            <td class="text-center" ng-bind="w1.created"></td>
                                            <td class="text-center" ng-bind="w1.amount_cny"></td>
                                            <td class="text-center" ng-bind="w1.score"></td>
                                            <td class="text-center">
                                                <a href="/user/detail/index?id={{ w1.userId }}" class="btn btn-xs btn-link"><i class="fa fa-search"></i>查看</a>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <!-- /.box-body -->
                                <div class="box-footer text-center" ng-show="wxLoadMore">
                                    <a href="javascript:void(0);" ng-click="loadMoreWx(1)" class="uppercase">查看更多</a>
                                </div>
                            </div>
                            <!-- /.box -->
                        </div>

                        <div class="tab-pane" id="tab_4">
                            <div class="text-center" style="padding: 10px;" ng-if="!wxLevel2 || wxLevel2.length == 0">
                                暂无下线
                            </div>
                            <div class="box" ng-show="wxLevel2.length>0">
                                <div class="box-body no-padding">
                                    <table class="table table-condensed">
                                        <tr>
                                            <th class="text-center" style="width: 90px">用户ID</th>
                                            <th class="text-center" style="width: 80px;">头像</th>
                                            <th class="text-center" style="width: 150px;">昵称</th>
                                            <th class="text-center" style="width: 80px;">创建时间</th>
                                            <th class="text-center" style="width: 80px;">钱包</th>
                                            <th class="text-center" style="width: 80px;">积分</th>
                                            <th class="text-center" style="width: 80px">操作</th>
                                        </tr>
                                        <tr class="v-middle" ng-repeat="w2 in wxLevel1">
                                            <td class="text-center" ng-bind="w2.userId"></td>
                                            <td class="text-center">
                                                <img class="underline-headimg" onerror="this.src='/assets/admin/img/head.png'" ng-src="{{ w2.headimgurl ? w2.headimgurl : '/assets/admin/img/head.png' }}" alt="">
                                            </td>
                                            <td class="text-center">
                                                <a href="/user/detail/index?id={{ w2.userId }}" ng-bind="w2.nickname"></a>
                                            </td>
                                            <td class="text-center" ng-bind="w2.created"></td>
                                            <td class="text-center" ng-bind="w2.amount_cny"></td>
                                            <td class="text-center" ng-bind="w2.score"></td>
                                            <td class="text-center">
                                                <a href="/user/detail/index?id={{ w2.userId }}" class="btn btn-xs btn-link"><i class="fa fa-search"></i>查看</a>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <!-- /.box-body -->
                                <div class="box-footer text-center" ng-show="wxLoadMore">
                                    <a href="javascript:void(0);" ng-click="loadMoreWx(2)" class="uppercase">查看更多</a>
                                </div>
                            </div>
                            <!-- /.box -->
                        </div>
                    </div>
                </div>
            </div>
            <!-- /.col -->


        </div>
        <!-- /.row -->

    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php $this->load->view('admin/public/foot.html', array('js' => array(
    '/assets/admin/js/user/detail.js'
))); ?>
